Don't update the same path source multiple times
authorAlex Crichton <alex@alexcrichton.com>
Wed, 20 May 2015 05:50:26 +0000 (22:50 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 20 May 2015 05:57:37 +0000 (22:57 -0700)
commitef8c651af1ce84ac1f4c6cc383f92a48762842b0
tree6da52bad20a44dfd33a89d039a2638395d8005fe
parenta1778efa74b67104d3b91e61c1fc584b72f32f9a
Don't update the same path source multiple times

Updating a path source can be a possibly expensive operation (lots of
directories that need to be traversed), and currently the root path source is
updated three times:

* Once when the root package is initially loaded.
* Again when the first resolution pass happens over a graph.
* Finally a third when the second resolution pass happens over the graph.

This commit pushes through the original `Source` trait object into the
`PackageRegistry` and removes the implicit call to `add_sources`, pushing that
call up to the stack a bit.
src/cargo/core/registry.rs
src/cargo/ops/cargo_compile.rs
src/cargo/ops/cargo_fetch.rs
src/cargo/ops/cargo_generate_lockfile.rs
src/cargo/ops/cargo_package.rs
src/cargo/ops/resolve.rs
src/cargo/sources/path.rs